* {
  box-sizing: border-box;
}

body {
  padding: 0;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  position: relative;
  width: 200px;
  height: 200px;
  /* border: 1px solid blue; */
  display: flex;
  align-items: center;
  justify-content: center;
}
.items {
  display: none;
  width: 200px;
  height: 100px;
  /* border: 1px solid red; */
  position: relative;
  overflow: hidden;
}

.item {
  bottom: 0px;
  text-align: center;
  left: 60px;
  width: 70px;
  height: 70px;
  position: absolute;
  font-size: 70px;
  transition: all 1s ease;
  transform: rotate(120deg);
  transform-origin: 30px 80px;
  color: #3498db;
  /* border: 1px solid red; */
}


.control {
  position: absolute;
  bottom: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: all 0.2s ease;
}

button {
  padding: 5px 10px;
}

h1 {
  padding: 0 0;
  margin: 15px 0;
}

.ready {
  position: absolute;
  width: 200px;
  bottom: 0px;
  left: 30px;
  font-size: 30px;
  display: none;
}

.item.in {
  transform: rotate(0deg);
  animation: goin 0.5s ease-in-out;
}

.item.out {
  transform: rotate(-120deg);
  animation: goout 0.5s ease-in-out;
}

@keyframes goin {
  0% {
    transform: rotate(120deg);
  }

  30% {
    transform: rotate(-20deg);
  }
  60% {
    transform: rotate(20deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

@keyframes goout {
  0% {
    transform: rotate(0deg);
  }

  60% {
    transform: rotate(20deg);
  }
 
  100% {
    transform: rotate(-120deg);
  }
}
